package com.qf.service.impl;

import com.qf.entity.Emp;
import com.qf.mapper.EmpMapper;
import com.qf.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * --- ONE PIECE ---
 *
 * @author yangjiangcheng
 * @date 2025/8/9
 * @desc
 */
@Service
public class EmpServiceImpl implements EmpService {
    /**
     * 注入mapper对象,这个对象是由主类
     * 上@MapperScan产生的代理对象
     */
    @Autowired
    private EmpMapper empMapper;

    @Override
    public Emp findEmpByEmpno(int empno) {
        return empMapper.findEmpByEmpno(empno);
    }

    @Override
    public List<Emp> list() {
        return empMapper.list();
    }

    @Override
    public Emp loginEmpnameAndNo(int empno, String ename) {
        return empMapper.loginEmpnameAndNo(empno,ename);
    }

    @Override
    public int empAdd(Emp emp) {
        return empMapper.empAdd(emp);
    }

    @Override
    public int empUpdate(Emp emp) {
        return empMapper.empUpdate(emp);
    }

    @Override
    public int empDelete(int empno) {
        return empMapper.empDelete(empno);
    }

    @Override
    public List<Emp> listByMap(Map<String, String> map) {
        return empMapper.listByMap(map);
    }
}
